#ifndef STRAIGHTSEGMENT_H
#define STRAIGHTSEGMENT_H

#include "tracksegment.h"

class StraightSegment : public TrackSegment
{
public:
    StraightSegment(QGraphicsItem* parent = nullptr);
    
    double length() const override;
    QPointF getPointAt(double distance) const override;
    double getAngleAt(double distance) const override;
    
    void updatePath() override;
    void setLength(double length) override;
    
    QPointF startPoint() const { return m_startPoint; }
    QPointF endPoint() const { return m_endPoint; }
    
    void setStartPoint(const QPointF& point);
    void setStartPoint(qreal x,qreal y );
    void setEndPoint(const QPointF& point);
    void setEndPoint(qreal x,qreal y );
    
private:
    double m_length;
    QPointF m_startPoint;
    QPointF m_endPoint;
};

#endif // STRAIGHTSEGMENT_H
